package com.example.houseman.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 建筑类型
 *
 * @author lzj
 */
public enum TenantManage {
    ZU("整租（分散式）", 0),
    HZ("合租（分散式）", 1),
    DSGY("公寓（集中式）", 2);

    @JsonValue
    private String name;

    @EnumValue
    private int index;

    private TenantManage(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (TenantManage c : TenantManage.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
